import fetch from 'common/src/utils/fetch';
function listStudentScorePage(data) {
    return fetch({
        url:
            '/api/scoremanagementservice/studentScoreQuery/listStudentScorePage',
        method: 'post',
        data
    });
}

/**
 * 学生成绩信息导出
 * @param {*} data
 */
function exportScoreQuery(params, studentIds = '') {
    let url = '/api/scoremanagementservice/studentScoreChange/studentScoreChangeExport';
    let string = '';
    for (var key in params) {
        if (params[key] === '') {
            continue;
        }
        string += `${key}=${params[key]}&`;
    }
    let restApi = `${url}?${string.substring(0, string.length - 1)}`;
    return fetch({
        url: restApi,
        method: 'post',
        headers: { 'Content-Type': 'text/plain;charset=UTF-8' },
        responseType: 'blob',
        data: studentIds
    });
}
const studentScoreQuery = {
    listStudentScorePage: listStudentScorePage,
    exportScoreQuery: exportScoreQuery
};

export default studentScoreQuery;
